#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	char arr[1000];
	gets(arr);
	int num = 0;
	int flat = 0;
	for (int i = 0; arr[i] != '\0'; i++)
	{
		if (arr[i] == ' ')
			flat = 0;
		else if (flat == 0)
		{
			num++;
			flat = 1;
		}
	}
	printf("%d\n", num);
	return 0;
}